Method and apparatus for reversible compression of information-carrying symbols

ABSTRACT

A method of reversibly compressing a sequence x(k) of information-carrying symbols, preferably digital signals which can assume Q discrete values, K being an index assuming integral number values, and consists in that the sequence x(k) is processed in means (1) to form a residue w(k), whereafter a modulo Q operation is carried out on the residue w(k). The modulo Q reducing sequence w(k) is finally encoded to form a compressed sequence n(k), which contains the same information as the original sequence x(k). In reconstructing the sequence x(k), the compressed sequence n(k) is decoded and subsequently processed in inversion means (5) to form a sequence y(k), on which a modulo Q operation is carried out, whereby the original sequence n(k) is obtained. An apparatus for carrying out the method includes means (1), means (2) for carrying out the modulo Q operations and an encoder (3). For carrying out the reconstruction it further includes a decoder (4), means (5) and means (6) for carrying out the modulo Q operation.

TECHNICAL FIELD

The present invention relates to a method of reversibly compressing asequence x(k) of information-carrying symbols which can assume Qdiscrete values, k being an index which assumes integral number values,the method being that the sequence x(k) of information-carrying symbolsis processed in means such as to form a residue w(k), and that theresidue w(k) is encoded to form a compressed sequence n(k) ofinformation-carrying symbols which contain the same information as theoriginal sequence x(k).

The invention also relates to an apparatus for carrying out the method.

In practically all connections where digital information is handled,there is the interest of representing the information with as fewcharacters as possible, in most cases with binary digits. This is thecase, for example, in storing information in different memories, when itis desired to store as much information as possible in a given memoryspace. Another case is in the transmission of such as digitally codedspeech and image information, when it is desired to transmit as muchinformation as possible with as few bits as possible in order todecrease the transmission rate requirements.

BACKGROUND ART

A known method of compressing digital information is to use acompression technique which is called "predictive coding", and has beendescribed, e.g. in P. Elias: Predictive Coding, Part I and II, IRETrans. Info. Theory, Vol IT-1, March 1955, pages 16-33, and US-Pat. No.2,605,361, C. C. Cutler, 1952. This technique includes two operationscomprising:

(1) creating a sequence of residues containing the same or nearly thesame information as the original sequence of digital signals,

(2) encoding the sequence of residues, e.g. with the aid of binarysymbols.

DISCLOSURE OF THE INVENTION

The sequence of residues in operation 1 is formed by predicting thevalue of following digital signals in the sequence with the aid of theprevious digital signals in the sequence. The difference between theactual digital signal and the predicted signal constitutes the residue.The object of achieving the sequence of residues is to reduce theredundancy in the original sequence of digital signals. In the secondoperation the residues are encoded, the encoding suitably taking placewith code words of varying length, so that residues which occur oftenare encoded with shorter code words than the residues occuring moreseldom.

The object of the present invention is to provide a method andapparatus, with which improved reversible data compression can beachieved.

The object is achieved by a method described in the introduction,characterized by a module Q being carried out on the residues beforeencoding.

The object is also achieved by an apparatus for carrying out the method,and is characterized by means arranged before the encoder for carryingout a module Q operation.

A higher compression degree can be achieved with this method andapparatus than what is possible with merely reversible predictivecoding. The compression degree which can be achieved is determined bythe entropy of the sequence w(k) of digital signals after the module Qoperation has been executed. The first order entropy, which correspondsto an encoder which encodes w(k) separately for successive values of kis equal to: ##EQU1## where P_(w) (j) is the relative frequency ofw(k)=j, where j=0, 1, . . . , Q-1. The entropy will be lower, and thusthe compression degree higher for w(k) that for w(k). This is aconsequence of several values of w(k) resulting in the same value ofw(k).

For example, if the case is assumed where the next digital signal, i.e.x(k), is predicted to have the same value as the previous digitalsignal, i.e. x(k-1), the residue thus being w(k)=x(k)-x(k-1), and thatQ=256, the residue w(k) will assume the integral number values in theinterval (-255, 255). The reduction modulo 256 signifies that w(k) islimited to the interval (0, 255), e.g. by w(k)=-17 and w(k)=239, bothgiving w(k)=239.

If w₁ (k)=j₁ and w₂ (k)=j₂ both are allowed to result in w(k)=j, theentropy for w(k) will include two terms:

    -[P.sub.w (j.sub.1) log P.sub.w (j.sub.1)+P.sub.w (j.sub.2) log P.sub.w (j.sub.2)],

which in the entropy H_(w) (k) for w are corresponded to by a term

    -P.sub.w (j) log P.sub.w (j)

whereby P_(w) (j)=P_(w) (j₁)+P_(w) (j₂).

Since

    (a+b) log (a+b)>a log (a)+b log (b)

for a, b>0 it follows that H_(w) ≦H_(w), i.e. that the compressiondegree for the sequence of digital signals which has been subjected to amodulo Q operation is greater than for the one that has not beensubjected to such an operation.

Apart from the advantage of the higher compression degree, the methodand apparatus in accordance with the invention has the advantage thatthe encoder will be more simple by that the number of code words will besmaller, since w(k) has a smaller symbol alphabet than w(k). Inaddition, the invention allows simplified realization of the predictormeans.

BRIEF DESCRIPTION OF DRAWINGS

The present invention will now be described by means of the variousembodiments and with reference to the accompanying drawings, in which

FIG. 1 is a block diagram illustrating an apparatus in accordance withthe invention,

FIGS. 2A and 2B are block diagrams and illustrate the general structurefor the means included in the blocks R and R⁻¹ in FIG. 1,

FIGS. 3A and 3B being block diagrams and illustrating the constructionof the apparatus in accordance with the invention in the case where theblock R is a transversal filter.

BEST MODES FOR CARRYING OUT THE INVENTION

FIG. 1 thus illustrates the general appearance of an apparatus inaccordance with the invention, which includes means 1 for forming aresidue, means 2 for carrying out a modulo Q operation and an encoder 3.This part of the apparatus executes a compression of a sequence x(k), K=. . . -1, 0, 1, 2 . . . of digital signals forming the input signal tothe apparatus. The digital signals may be samples of an analogue signal,these samples assuming Q discrete values between 0 and Q-1. The sequencex(k) is fed to the means 1, which forms the residue w(k), where k= . . .-1, 0, 1, 2 and the residue is modulo Q reduced in the means 2, thesequence w(k) being formed. This sequence is then fed to the encoder 3which encodes the sequence w(k) using some known method, e.g. Huffmanencoding, a sequence n(k) of code words containing the same informationas the original sequence x(k) being formed. The code word sequence n(k)thus constitutes the compressed sequence, and can be stored in a memoryor sent to some other apparatus.

When it is desired to reconstruct the original sequence x(k) from thecompressed sequence n(k) the apparatus shown in the lower part of FIG. 1is utilized, this apparatus including a decoder 4, inversion means 5,which carry out an inversion operation in relation to the operationcarried out by means 1 for forming a residue, and means 6 for carryingout a modulo Q operation. In this part of the apparatus the compressedsequence n(k) is decoded in the decoder 4, the input signal sequencew(k) to the encoder 3 being recreated. This sequence w(k) is fed to theinversion means 5, which form a sequence y(k), which is fed to the means6, which carries out a modulo Q operation on the sequence, the originalsequence x(k) thus being retrieved.

The general structure of the inversion means 5 and the means 1 forforming the residue illustrated in the block diagram of FIG. 1illustrated in FIGS. 2A and 2B. The means 1 include a predictor 21receiving on its input the sequence x(k) of digital signals which are tobe compressed and on its output sending the negated, predicted value toan adder 23. The sequence x(k) is also connected as input signal to amultiplier 22, where it is multiplied by a coefficient f₀. The outputfrom the multiplier 22 is connected to the adder 23, which sends theresidue w(k) on its output.

The inversion means 5 have the appearance illustrated in FIG. 2B, andincludes a predictor 25 receiving the output signal y(k) on its inputfrom the circuit, this predictor sending the predicted value on itsoutput to an input of adder 26, which receives on its second input thedecoded sequence w(k) and has its output connected to a multiplier 27,which receives the coefficient f₀ ⁻¹ on its second input, its outputsignal being the same as the output signal y(k) from the circuit.

The predictor 21 is a means, generating from a sequence x(k) of thevalues, a value:

    p(k)=P[x(k-1), x(k-2), x(k-3), . . . ]

The function P[x] can be completely arbitrary linear, non-linear,recursive etc. The only condition is that the generated value w(k) is apositive or negative integral number. The predictor 25 functions in acorresponding way as the predictor 21. The predictors 21 and 25 may berealized, for example, as an entirely general function S[x]=S[x(k-1),x(k-2), . . . ] followed by an optional quantizer.

At the start of the compressed and reconstruction, e.g at k=0, it isnecessary to know x(k) and y(k) for k=-1, -2, -3 . . . in order tocalculate p(k). This problem is solved by putting these values equal tozero or to some other arbitrary definite sequence of values. The means 1and inversion means 5 are thus allowed to start from the same state.

In the following, with reference to FIGS. 3A and 3B, there isillustrated the construction of the apparatus in accordance with theinvention when the means 1 is a transversal filter. In this case theresidue w(k) is formed as: ##EQU2## where f_(i) are weightingcoefficients, where i=0, 1 . . . , N. The method in accordance with theinvention assumes that the weighting coefficients f_(i) are integralnumbers. Examples of such filters as are usable as in this connectionare

    ______________________________________                                        N = 1   f.sub.0 = 1,                                                                            f.sub.1 = -1                                                N = 2   f.sub.0 = 1,                                                                            f.sub.1 = -2,                                                                            f.sub.2 = 1                                      N = 3   f.sub.0 = 1,                                                                            f.sub.1 = -3,                                                                            f.sub.2 = 3,                                                                        f.sub.3 = -1                               ______________________________________                                    

which form the first, second and the third difference of the sequencex(k).

An example is illustrated in FIG. 3A of how the means 1 for forming theresidue w(k) can appear in the case where N=3. The means 1 then includedelay units 31, receiving the sequence x(k) as an input signal forcompression and which each delays the input signal by a time unit sothat when x(k) appears on the input of the delay unit, x(k-1) occurs onits output. In addition, there is included the multiplier 32, receivingon one input the signal from the respectively delay unit 31, and on itsother input the integral number coefficient f_(i) by which the x-valueis to be multiplied. The outputs of the multipliers are connected to theinputs of an adder 33, the residue w(k) being obtained on the output ofthis adder. The output from the adder 33 is the same as the output fromthe means 1 in FIG. 1, and the remainder of the apparatus agrees withcorresponding parts of the apparatus in FIG. 1, this part thus not beingdescribed in more detail.

In an alternative embodiment, modulo Q operations can be carried outinside the filter, when the filter is linear, as in this case, by themultipliers 32 and the adder 33 being formed as modulo Q multipliers andmodulo Q adder, respectively the circuit then being particularly simpleto realize, especially when Q is a power of 2.

The reconstruction takes place using an inversion filter which carriesout the operation: ##EQU3## where f₀ ⁻¹ is the inverse modulo Q for f₀.

An example is illustrated in FIG. 3B of how the inversion filter can beimplemented i the case with the assumption made above that N=3. Thefilter includes an adder 35, receiving on an input the decoded sequencew(k), which is to be added to the terms on the other inputs. The outputfrom the adder 35 is connected to a multiplier 36, receiving thecoefficient f₀ ⁻¹ on its second input, and having its output signal y(k)forming the output signal from the filter and the input signal to delayunits 37, in which the y-value is delayed by a time unit, so that wheny(k) occurs on the delay unit input, y(k-1) occurs on its output. Theoutputs from the delay units 37 are connected to the multipliers 38,receiving the coefficients -f₁, -f₂ and -f₃ on their second inputs andhaving their outputs connected to the adder 35. The decoder 4 and themeans 6 for carrying out the modulo Q operations are the same as thoseshown in FIG. 1.

The original sequence x(k) is thus obtained as x(k)=y(k) modulo Q.

In order that the reconstruction will give the correct result, f₀ ⁻¹must exist, which means that the equation f₀ ×f₀ ⁻¹ =1 modulo Q musthave a solution for some f₀ ⁻¹ =0, 1, . . . , (Q-1).

This is the case if f₀ and Q are selected such that they are relativelyprime, i.e. lack common factors different from 1. The above mentionedfilters meet all these requirements for arbitrary Q, since they have f₀=1.

In an alternative embodiment, as with the case FIG. 3A, modulo Qoperations can be carried out inside the filter by that the multipliers36 and 38 and the adder 35 being formed as modulo Q multipliers and amodulo Q adder, respectively.

It should further be mentioned that the invention can be realized ioneither hardware or software.

Finally it should be emphasized that even though the invention has beendescribed as applied to digital signals, it covers reversiblecompression of all information-carrying symbols for which addition,subtraction, multiplication and modulo Q operations can be defined.

I claim:
 1. A method of increasing the compression degree whenreversibly compressing a sequence x(k) of information carrying symbolswhich can assume Q discrete values, where k is an integral number,comprisingprocessing said sequence x(k) by creating a prediction valuep(k) from at least one of the previous symbols in said sequence x(k) andforming a residue w(k) from said prediction value p(k) and from a numberof (N) of said symbols x(k), executing a modulo Q-operation on saidresidue w(k) such that the entropy for the residue w(k) thus obtained isdecreased thereby increasing the compression degree of said sequencex(k), coding the residue w(k) to form a compressed sequence n(k) ofinformation carrying symbols which contains the same information as theoriginal sequence of symbols.
 2. A method as claimed in claim 1, whereinthe processing step of forming a residue w(k) being a linear filter,which forms the residue w(k) with the aid of additions andmultiplications, characterized in that the additions and multiplicationsare executed as modulo Q additions and modulo Q multiplications.
 3. Amethod as claimed in claim 2, characterized in that Q is a power of 2.4. A method as claimed in claim 1, characterized in that Q is a power of2.
 5. A method of reconstructing a sequence x(k) of information-carryingsymbols, which have been compressed according to one of the preceedingclaims, said reconstruction method implying that the compressed sequencen(k) is decoded and that the decoded sequence w(k) is processed ininversion means (5) to form a sequence y(k), characterized in that amodulo Q operation is carried out on the sequence y(k) from theinversion means (5) to obtain the original sequence x(k).
 6. A method asclaimed in claim 5, said means (5) for forming the sequence y(k) being alinear inversion filter, which forms the sequence y(k) with the aid ofadditions and multiplications, characterized in that the additions andmultiplications are carried out as modulo Q and modulo Qmultiplications, respectively.
 7. A method as claimed in claim 6,characterized in that Q is a power of
 2. 8. A method as claimed in claim5, characterized in that Q is a power of
 2. 9. Apparatus for compressinga sequence x(k) which can assume Q discrete values, where k is anintegral number, comprisingfirst means (1) to form a residue w(k) havinga starting point in said sequence x(k) of information carrying symbols,second means (2) to perform a modulo Q-operation on said residue w(k),the entropy for the residue w(k) thus obtained being decreased, andcoding means (3) to perform a predictive coding of the residue w(k) tocreate a compressed sequence n(k) of information carrying symbolscontaining the same information as the original sequence x(k) ofinformation carrying symbols.
 10. Apparatus as claimed in claim 9, themeans (1) for forming a residue w(k) being a linear filter, which formsthe residue w(k) with the aid of adders and multipliers, characterizedin that the adders and multipliers are modulo Q adders and modulo Qmultipliers.
 11. Apparatus for reconstructing a sequence x(k) ofinformation-carrying symbols which have been compressed with apparatusas claimed in claim 10, said reconstruction apparatus including adecoder (4), which is adapted to decode the compressed sequence n(x) toform a decoded sequence w(k), and inversion means (5) adapted to form asequence y(k) by an inversion operation on the sequence w(k),characterized by means (6) for carrying out a modulo Q operation on thesequence y(k) from the inversion means (5) for obtaining the originalsequence x(k).
 12. Apparatus for reconstructing a sequence x(k) ofinformation-carrying symbols which have been compressed with apparatusas claimed in claim 9, said reconstruction apparatus including a decoder(4), which is adapted to decode the compressed sequence n(x) to form adecoded sequence w(k), and inversion means (5) adapted to form asequence y(k) by an inversion operation on the sequence w(k),characterized by means (6) for carrying out a modulo Q operation on thesequence y(k) from the inversion means (5) for obtaining the originalsequence x(k).
 13. Apparatus for reconstructing a sequence x(k)according to claim 12, said means (5) for forming the sequence y(k)being a linear inversion filter which forms the sequence y(k) with theaid of adders and multipliers, characterized in that the adders andmultipliers are modulo Q adders and modulo Q multipliers, respectively.